package com.example.chat.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.chat.utils.EncryptHander;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@TableName(value = "chat_message",autoResultMap = true)
@NoArgsConstructor
@AllArgsConstructor
public class ChatMessage {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @TableField("sender")
    private Long sender;
    @TableField("receiver")
    private Long receiver;
    @TableField(value = "message",typeHandler = EncryptHander.class)
    private String message;
    @TableField("status")
    private Long status;
    @TableField("create_time")
    private String createTime;
    @TableField("update_time")
    private String updateTime;
}
